function request(options) {
  return new Promise((resolve, reject) => {
    uni.request({
      url: options.url, 
      method: options.method || 'GET',
      data: options.data || {},
      header: options.header || {'Content-Type': 'application/json'},
      success: (res) => {
        if(res.statusCode === 200) {
          resolve(res);
        } else {
          reject(res);
        }
      },
      fail: (err) => {
        reject(err);
      }
    });
  });
}
 export default {
  request: request
};